import Pool from "../@base/Pool"

/** 状态机 */
let instance: Machine;

export default class Machine {
  pool!: Pool;

  constructor() {
    if (instance) return instance

    instance = this
    this.pool = new Pool()
    this.reset()
  }

  reset() {

  }

  /**
   * 回收敌人，进入对象池
   * 此后不进入帧循环
   */
  // removeEnemey(enemy) {
  //   const temp = this.enemys.shift()
  //   temp.visible = false
  //   this.pool.recover('enemy', enemy)
  // }
}